home *** CD-ROM | disk | FTP | other *** search
/ Movie Clips Screensaver / Movie Clips Screen Saver.iso / expert.mst < prev    next >
Encoding:
Text File  |  1995-01-25  |  20.5 KB  |  716 lines

  1. '$define debug
  2.  
  3. '$include 'setupapi.inc'
  4. '$include 'msdetect.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6.  
  7. ''Standard Dialog ID's : Make sure these are consistent with STDCUI.H file.
  8.  
  9. const WELCOME = 100
  10. const ASKQUIT = 200
  11. const DESTPATH = 300
  12. const EXITQUIT = 600
  13. const EXITSUCCESS = 700
  14. CONST EXITFAILURE   = 400
  15. CONST APPHELP       = 900
  16. CONST CHECK         = 2500
  17. CONST SMALLWIN      = 2200
  18. CONST RESTART       = 2600
  19. CONST RESTARTII     = 2700
  20.  
  21. ''Custom Dialog ID's : Make sure these are consistent with CUIDLG.H file.
  22.  
  23. const SELECTMODE = 6201
  24. const SELECTCHIP = 6202
  25. const SELECTSIZE = 6203
  26. const TOOBIG = 6204
  27. const SELECTCLIPS = 6205
  28. const SELECTPLAYER = 6206
  29. const NEWEXTWARNING = 6207
  30. const CHOOSECDROM = 6208
  31.  
  32. '' Error IDs
  33.  
  34. const ERR_BADVGAMODE = 8000
  35. const ERR_BADCPU = 8001
  36. const ERR_BADWINDOWSPATH = 8002
  37. const ERR_BADPATH = 8003
  38.  
  39. ''Bitmap ID
  40.  
  41. const LOGO = 6101
  42.  
  43. ''Bitmap ID
  44. CONST VFWLOGO = 1
  45.  
  46.  
  47. ''Chip sets : Make sure these are consistent with the WhatVga DLL
  48.  
  49. const CIRRUS = 100
  50. const EVEREX = 101
  51. const PARADISE = 102
  52. const TSENG = 103
  53. const TRIDENT = 104
  54. const T8900 = 105
  55. const ATIVGA = 106
  56. const AHEADA = 107
  57. const AHEADB = 108
  58. const OAKTECH = 109
  59. const VIDEO7 = 110
  60. const CHIPSTECH = 111
  61. const TSENG4 = 112
  62. const GENOA = 113
  63. const NCR = 114
  64. const COMPAQ = 115
  65. const UNKNOWN = -1
  66.  
  67. ''User interface DLL name
  68.  
  69. const UIDll$ = "cui.dll"
  70.  
  71. ''Constants for functions
  72.  
  73. ''GetProcessor
  74.  
  75. const IS386 = 3
  76.  
  77. ''GetDeviceCaps
  78.  
  79. const NUMCOLORS = 24
  80. const SIZEPALETTE = 104
  81.  
  82. '' Global variable declaration
  83.  
  84. global ExpertPath$     ''Default destination directory.
  85. global WindowsDir$      ''Windows directory.
  86. global ExpertIniPath$  ''Path to the INI file to be used
  87. GLOBAL SizeReq&  '' Total Disk Size required for installation
  88.  
  89. ''File Types
  90. GLOBAL WinDir$
  91. GLOBAL WinSysDir$
  92. GLOBAL WinSys32Dir$
  93. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  94. GLOBAL CHECKSTATES$
  95. GLOBAL MinorVer%
  96. GLOBAL OnNT$
  97.  
  98. '' functions/procedure declaration
  99. declare sub ConfirmQuit
  100. declare function MakePath (szDir$, szFile$) as string
  101. declare function GetColors() as integer
  102. DECLARE SUB VFW_Install
  103. DECLARE SUB VFW_Init
  104.  
  105. '' External function/procedure declaration
  106.  
  107. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  108. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  109. DECLARE SUB Reboot LIB "iniupd.dll"
  110. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  111. declare function GetDC lib "USER.EXE" (hwnd%) as integer 
  112. declare function ReleaseDC lib "USER.EXE" (hwnd%, hdc%) as integer
  113. declare function GetDeviceCaps lib "GDI.EXE" (hdc%, iCapabilities%) as integer
  114.  
  115. Init:   '' Start here
  116.  
  117.     '' Set up the error traps
  118.  
  119.     on error goto HandleError
  120.  
  121.     '' Set up the way the install program looks
  122.  
  123.     SetBitmap UIDll$, LOGO
  124.     SetTitle "Expert Movie Clips Screen Saver Setup"
  125.  
  126.     '' Make sure proper hardware is there
  127.  
  128.     if GetProcessorType() < IS386 then
  129.  
  130.         '' We aren't on a 386 or above. FATAL!
  131.  
  132.         error ERR_BADCPU
  133.  
  134.     end if
  135.  
  136.     i% = GetColors()
  137.  
  138.     if i% <= 16 then
  139.  
  140.         '' make sure we didn't just wrap around...
  141.  
  142.         if i% >= 0 then
  143.  
  144.             '' We don't have a VGA driver with 256 colors
  145.             '' installed. FATAL!
  146.  
  147.             error ERR_BADVGAMODE
  148.  
  149.         end if
  150.  
  151.     end if
  152.  
  153.     '' Find the INF file
  154.  
  155.     szInfPath$ = GetSymbolValue("STF_SRCINFPATH")
  156.     if szInfPath$ = "" then
  157.         '' No predefined path for INF file, so just assume it is in
  158.         '' the current directory.
  159.  
  160.         szInfPath$ = GetSymbolValue("STF_CWDDIR") + "EXPERT.INF"
  161.     end if
  162.  
  163.     '' Load in the INF file
  164.  
  165.     ReadInfFile szInfPath$
  166.  
  167.     '' Set the size checking mode
  168.  
  169.     i% = SetSizeCheckMode(scmOnIgnore)
  170.  
  171.     '' Check that windows diectory is writable
  172.  
  173.     WindowsDir$ = GetWindowsDir()
  174.     i% = IsDirWritable(WindowsDir$)
  175.     if i% = 0 then
  176.  
  177.         '' Error: can't write to windows directory. exit.
  178.  
  179.         error ERR_BADWINDOWSPATH
  180.  
  181.     endif
  182.  
  183.     '' setup the ini path
  184.  
  185.     ExpertIniPath$ = MakePath(WindowsDir$, "CONTROL.INI")
  186.  
  187. DOWELCOME:
  188.  
  189.     sz$ = UIStartDlg(UIDll$, WELCOME, "FInfoDlgProc", 0, "")
  190.     if sz$ = "CONTINUE" then
  191.         UIPop 1
  192.     else
  193.         ConfirmQuit
  194.         goto DOWELCOME
  195.     end if
  196.  
  197.     '' Do the main thing
  198.  
  199. GETPATH:
  200.  
  201.     '' Set up symbols as parameters for dialog box
  202.  
  203.     if mid$(WindowsDir$, 2, 1) = ":" then
  204.         DefExpertPath$ = mid$(WindowsDir$, 1, 2) + "\XMOVIE"
  205.     else
  206.         DefExpertPath$ = "C:\XMOVIE"
  207.     end if
  208.  
  209.  
  210.     SetSymbolValue "EditTextIn", DefExpertPath$
  211.     SetSymbolValue "EditFocus", "ALL"
  212.  
  213. GETPATHL1:
  214.  
  215.     sz$ = UIStartDlg(UIDll$, DESTPATH, "FEditDlgProc", 0, "")
  216.     ExpertPath$ = GetSymbolValue("EditTextOut")
  217.  
  218.     if sz$ = "CONTINUE" then
  219.  
  220.         '' Make sure our target is writable
  221.  
  222.         if IsDirWritable(ExpertPath$) = 0 then
  223.  
  224.             error ERR_BADPATH
  225.  
  226.             '' will resume here
  227.  
  228.             err = 0
  229.             goto GETPATHL1
  230.  
  231.         end if
  232.  
  233.         UIPop 1
  234.  
  235.     elseif sz$ = "REACTIVATE" then
  236.         goto GETPATHL1
  237.     else
  238.         ConfirmQuit
  239.         goto GETPATH
  240.     end if
  241.  
  242.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  243.     CreateDir ExpertPath$, cmoNone
  244.  
  245.     '' Determine the speed of the machine. For the moment ignore this and
  246.     '' just use default for rate and simple size selection
  247.  
  248.     '' default for speed
  249.  
  250.     Rate$ = "30"
  251.  
  252.     '' select the size of the player
  253.  
  254.     Size$ = "320"
  255.     Small$ = "0"
  256.  
  257. STARTCOPYING:
  258.  
  259.     '' Add standard files to the copy list
  260.  
  261.     AddSectionFilesToCopyList "Expert", SrcDir$, ExpertPath$
  262.     AddSectionFilesToCopyList "Background", SrcDir$, MakePath(ExpertPath$, "backgrnd")
  263.     AddSectionFilesToCopyList "Windows", SrcDir$, WindowsDir$
  264.  
  265.     '' Determine if there is enough disk space for the installation.
  266.     '' DiskSp& will be > 0 if there is NOT enough space. It will be 0 if there
  267.     '' is sufficient free disk space for the installation
  268.  
  269.     SpaceCost& = GetCopyListCost(szExtra$,szCosts$, szNeeded$)
  270.  
  271.     '' Tell user how much more space is needed.
  272.  
  273.     if (SpaceCost& > 0) then
  274.         SpaceCostKB% = SpaceCost& / 1000
  275.         sz$ = str$(SpaceCostKB%)
  276.         SetSymbolValue "SpaceNeeded", sz$
  277.  
  278.         sz$ = UIStartDlg(UIDll$, TOOBIG, "FTooBigDlgProc", 0, "")
  279.  
  280.         UIPop 1
  281.         error STFQUIT
  282.     endif
  283.  
  284.     '' Copy the files
  285.  
  286.     CopyFilesInCopyList
  287.  
  288.     '' Set up the ini file
  289.  
  290.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "MoviePath", ExpertPath$, cmoOverwrite
  291.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "CDROMPath", SrcDir, cmoOverwrite
  292.  
  293.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "ReelPath", MakePath(ExpertPath$, "movies.lst"), cmoOverwrite
  294.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Rate", Rate$, cmoOverwrite
  295.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Small", Small$, cmoOverwrite
  296.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Playtype", "1", cmoOverwrite
  297.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "PreferredExt", ".avi", cmoOverwrite
  298.  
  299.     '' Specify the default backdrop as TV. 0=theater;1=TV;2=newspaper
  300.  
  301.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Background", "1", cmoOverwrite
  302.  
  303.     '' Set up the backdrop files
  304.  
  305.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Bitmap0", MakePath(ExpertPath$, "backgrnd\closeup.dib") + ",160,77", cmoOverwrite
  306.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Bitmap1", MakePath(ExpertPath$, "backgrnd\bigtv.dib") + ",178,178", cmoOverwrite
  307.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Bitmap2", MakePath(ExpertPath$, "backgrnd\bigpaper.dib") + ",147,129", cmoOverwrite
  308.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "BackgroundX", "178", cmoOverwrite
  309.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "BackgroundY", "178", cmoOverwrite
  310.  
  311.     '' Add NULL/default values for other INI file keys
  312.  
  313.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Tiled", "0", cmoOverwrite
  314.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "BackgroundPath", "", cmoOverwrite
  315.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "History0", "", cmoOverwrite
  316.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "History1", "", cmoOverwrite
  317.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "History2", "", cmoOverwrite
  318.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "History3", "", cmoOverwrite
  319.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "InsertAfter", "26918", cmoOverwrite
  320.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Random", "1", cmoOverwrite
  321.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Overlap", "1", cmoOverwrite
  322.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Interval", "10", cmoOverwrite
  323.     CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "PWProtected", "0", cmoOverwrite
  324.  
  325.     ''Create the progman groups and items
  326.  
  327.     ExpertExe$ = MakePath(ExpertPath$, "Expert.exe")
  328.     ExpertSetup$ = ExpertExe$
  329.     ExpertRun$ = ExpertExe$ + " /s"
  330.  
  331.     CreateProgmanGroup "Expert Software", "", cmoNone
  332.     ShowProgmanGroup  "Expert Software", 1, cmoNone
  333.     CreateProgmanItem "Expert Software", "Movie Clips Editor", ExpertSetup$, "", 1024
  334.     CreateProgmanItem "Expert Software", "Play Movie Clips", ExpertRun$, "", 1024
  335.     
  336.     ExpertCredits$ = MakePath(ExpertPath$, "credits.wri")
  337.     CreateProgmanItem "Expert Software", "Readme", ExpertCredits$, "", 1024
  338.  
  339.     '' Exit with the proper dialog box
  340.  
  341. QUIT:
  342.  
  343.     '' choose a dialog depending on exit error condition
  344.  
  345.     if err = 0 then
  346.  
  347.         dlg% = EXITSUCCESS
  348.     ON ERROR GOTO VFW_ERRQUIT
  349.     VFW_Init
  350.  
  351.         goto SKIPEXTWARNING
  352.  
  353. EXTWARNING:
  354.  
  355.         sz$ = UIStartDlg(UIDll$, NEWEXTWARNING, "FInfo0DlgProc", 0, "")
  356.  
  357.         if sz$ = "REACTIVATE" then
  358.  
  359.             goto EXTWARNING
  360.  
  361.         end if
  362.  
  363.         UIPop 1
  364.  
  365. SKIPEXTWARNING:
  366.  
  367.     else
  368.  
  369.         dlg% = EXITQUIT
  370.  
  371.     end if
  372.  
  373. QUITL1:
  374.  
  375.     '' display a dialog
  376.  
  377.     sz$ = UIStartDlg(UIDll$, dlg%, "FInfo0DlgProc", 0, "")
  378.  
  379.     if sz$ = "REACTIVATE" then
  380.  
  381.         goto QUITL1
  382.  
  383.     end if
  384.  
  385.     UIPop 1
  386.  
  387.     end
  388.  
  389. HANDLEERROR:
  390.  
  391.     '' error handler
  392.  
  393.     select case ERR
  394.         case ERR_BADCPU
  395.             i% = DoMsgBox("This machine does not have a 80386 or above CPU.", "Expert Setup Error", MB_OK)
  396.         case ERR_BADVGAMODE
  397.             i% = DoMsgBox("This system is currently not capable of using 256 colors. Please install a 256 color device driver if available.", "Expert Setup Error", MB_OK)
  398.         case ERR_BADPATH
  399.             i% = DoMsgBox("The destination path is invalid. Please re-enter.", "Expert Setup Error", MB_OK)
  400.             resume next
  401.         case ERR_BADWINDOWSPATH
  402.             i% = DoMsgBox("The Windows directory on this machine is unwritable.", "Expert Setup Error", MB_OK)
  403.         case STFQUIT
  404.         case STFERR
  405.         case else
  406.             i% = DoMsgBox("Fatal error.", "Expert Setup Error", MB_OK)
  407.     end select
  408.  
  409.     goto QUIT
  410.  
  411. '*************************************************************************
  412. '**
  413. '** Helper routines
  414. '**
  415. '*************************************************************************
  416.  
  417. '**
  418. '** Purpose:
  419. '**     Asks the user whether or not they really want to exit
  420. '** Arguments:
  421. '**             None
  422. '*************************************************************************
  423.  
  424. sub ConfirmQuit static
  425.  
  426. ConfirmQuitStart:
  427.  
  428.     UIPopAll
  429.     sz$ = UIStartDlg(UIDll$, ASKQUIT, "FQuitDlgProc", 0, "")
  430.  
  431.     if sz$ = "EXIT" then
  432.  
  433.         UIPopAll
  434.         error STFQUIT
  435.  
  436.     elseif sz$ = "REACTIVATE" then
  437.  
  438.         GOTO ConfirmQuitStart
  439.  
  440.     else
  441.  
  442.         UIPopAll
  443.             
  444.     end if
  445.  
  446. END SUB
  447.  
  448. '**
  449. '** Purpose:
  450. '**     Appends a file name to the end of a directory path,
  451. '**     inserting a backslash character as needed.
  452. '** Arguments:
  453. '**     szDir$  - full directory path (with optional ending "\")
  454. '**     szFile$ - filename to append to directory
  455. '** Returns:
  456. '**     Resulting fully qualified path name.
  457. '*************************************************************************
  458.  
  459. function MakePath(szDir$, szFile$) static as string
  460.  
  461.     if szDir$ = "" then
  462.     MakePath = szFile$
  463.     elseif szFile$ = "" then
  464.     MakePath = szDir$
  465.     elseif mid$(szDir$, len(szDir$), 1) = "\" then
  466.     MakePath = szDir$ + szFile$
  467.     else
  468.     MakePath = szDir$ + "\" + szFile$
  469.     end if
  470.  
  471. end function
  472.  
  473. '' Determine size of the Windows color palette
  474. function GetColors() static as integer
  475.  
  476.     hdc% = GetDC(0)
  477.  
  478.     i% = GetDeviceCaps(hdc%, NUMCOLORS)
  479.     
  480.     dummy% = ReleaseDC(0, hdc%)
  481.  
  482.     GetColors = i%
  483.  
  484. end function
  485.  
  486. Sub VFW_Init Static
  487.   
  488.     VFW_CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  489.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  490.     
  491.     WIN32ENABLED% = 0
  492.     MajorVer% = GetWindowsMajorVersion()
  493.     MinorVer% = GetWindowsMinorVersion()
  494.     Processor% = GetProcessorType()
  495.     WinDir$ = GetWindowsDir()
  496.     DEST$ = GetWindowsDir()
  497.     WinSysDir$ = GetWindowsSysDir()
  498.     WinSys32Dir$ = WinDir$ + "system32"
  499.  
  500.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  501.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  502.     END
  503.     END IF
  504.  
  505.     'Prevents installation on 286
  506.     IF Processor% < 3 THEN
  507.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  508.     END
  509.     END IF
  510.  
  511.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  512.     IF OnWindowsNT() THEN
  513.       OnNT$ = "TRUE"
  514.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  515.       IF WowVersion$ = "" THEN
  516.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  517.          END
  518.       END IF
  519.     END IF
  520.  
  521.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  522.  
  523. VFW_WELCOME:
  524.     sz$ = UIStartDlg(VFW_CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  525.     IF sz$ = "CONTINUE" THEN
  526.        UIPop 1
  527.      ELSE
  528.     GOSUB VFW_ASKQUIT
  529.     GOTO VFW_WELCOME
  530.     END IF
  531.  
  532. ''Prepare Copy list and check size
  533.  
  534.     ClearCopyList
  535.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  536.  
  537. ''  Runtime files (on Windows disk)
  538. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  539.  
  540.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN                   'These files not necessary on Windows NT
  541.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  542.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  543.     END IF
  544.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  545.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  546.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  547.     IF OnNT$ = "TRUE" THEN
  548.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  549.     ENDIF
  550. ''*************************************************************************************************************************
  551. ''*************************************************************************************************************************
  552. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  553. ''and add a "DCI Provider" section with to the SETUP.INF file.
  554. ''
  555. ''      AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  556. ''*************************************************************************************************************************
  557. ''*************************************************************************************************************************
  558.  
  559. ''  Check windrive diskspace
  560.     SizeReq& = GetCopyListCost ("","", "")
  561.     IF SizeReq& <> 0 THEN
  562.     GOSUB SMALLWIN
  563.     END
  564.     END IF
  565.  
  566. VFW_Install
  567.  
  568. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  569. '' else, it gives the user the choice
  570.     RESTRT% = RestartListEmpty ()
  571.     Exe$ = DEST$ + "\_msrstrt.exe"
  572.     Batch$ = DEST$ + "\_mssetup.bat"
  573.     empty$ = ""
  574. RESTART:
  575.     IF RESTRT% = 0 THEN
  576.        sz$ = UIStartDlg(VFW_CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  577.        IF sz$ = "REACTIVATE" THEN
  578.       GOTO RESTART
  579.        ENDIF
  580.        I% = ExitExecRestart ()
  581.        RemoveFile Exe$, cmoForce
  582.        RemoveFile Batch$, cmoForce
  583.        END
  584.     ELSE
  585.        sz$ = UIStartDlg(VFW_CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  586.        IF sz$ = "CONTINUE" THEN
  587.       I% = ExitWindowsExec (Exe$, empty$)
  588.       IF I% = 0 THEN
  589.          GOTO RESTART
  590.       ELSE
  591.          END
  592.      ENDIF
  593.        ELSEIF sz$ = "EXIT" THEN
  594.       UIPopAll
  595.       END
  596.        ELSEIF sz$ = "REACTIVATE" THEN
  597.       GOTO RESTART
  598.        ELSE
  599.       UIPop 1
  600.        END IF
  601.     END IF
  602.  
  603.  
  604. VFW_QUIT:
  605.  
  606.     IF ERR = 0 THEN
  607.     dlg% = EXITSUCCESS
  608.     goto SKIPGOSUBS
  609.     ELSEIF ERR = STFQUIT THEN
  610.     dlg% = EXITQUIT
  611.     ELSE
  612.     dlg% = EXITFAILURE
  613.     END IF
  614. VFW_QUITL1:
  615.     sz$ = UIStartDlg(VFW_CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  616.     IF sz$ = "REACTIVATE" THEN
  617.     GOTO VFW_QUITL1
  618.     END IF
  619.     UIPop 1
  620.     GOTO SKIPGOSUBS
  621.  
  622. VFW_ASKQUIT:
  623.     sz$ = UIStartDlg(VFW_CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  624.  
  625.     IF sz$ = "EXIT" THEN
  626.     UIPopAll
  627. ''        ERROR STFQUIT
  628.     END
  629.     ELSEIF sz$ = "REACTIVATE" THEN
  630.     GOTO VFW_ASKQUIT
  631.     ELSE
  632.     UIPop 1
  633.     END IF
  634.     RETURN
  635.  
  636. SMALLWIN:
  637.     sz$ = UIStartDlg(VFW_CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  638.     IF sz$ = "REACTIVATE" THEN
  639.     GOTO SMALLWIN
  640.     END IF
  641.     UIPop 1
  642.     RETURN
  643.  
  644. SKIPGOSUBS:
  645.  
  646.     END SUB
  647.  
  648. VFW_ERRQUIT:
  649.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  650.     END
  651.  
  652.  
  653. '**
  654. '** Purpose:
  655. '**     Performs all installation operations.
  656. '** Arguments:
  657. '**     none.
  658. '** Returns:
  659. '**     none.
  660. '*************************************************************************
  661. SUB VFW_Install STATIC
  662.  
  663.     SetRestartDir WinDir$
  664.     CopyFilesInCopyList
  665.  
  666. ''Updating WIN.INI and SYSTEM.INI
  667. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  668.  
  669. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  670.     IF VflatdPresent() = 0 THEN
  671.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  672.     END IF
  673. END IF
  674.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  675.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  676.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  677.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
  678.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  679.     I% = DoesIniKeyExist (WinDir$ + "system.ini", "Drivers", "VIDC.RT21")
  680.     IF I% = 0  THEN
  681.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
  682.     END IF
  683.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
  684.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  685.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  686.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  687.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  688.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  689.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  690.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  691.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  692.  
  693. ''*************************************************************************************************************************
  694. ''*************************************************************************************************************************
  695. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the <provider> with your own file name
  696. ''
  697. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  698. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  699. ''*************************************************************************************************************************
  700. ''*************************************************************************************************************************
  701.  
  702. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  703. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  704.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  705.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  706.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  707.  
  708. '' Mplayer
  709.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  710.  
  711. END IF  ''NT and next version of Windows installation stop here.
  712.  
  713.     Run ("profdisp.exe")   
  714. END SUB
  715.  
  716.